package com.glasses.abc.data;

import com.glasses.abc.business.City;
import com.glasses.abc.business.Country;
import com.glasses.abc.business.ReportMenuItem;
import com.glasses.abc.business.Person;
import com.glasses.abc.business.Report;
import com.glasses.abc.business.TimeLog;
import com.glasses.abc.business.TopMenuItem;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;

/**
 *
 * @author Jean-Luc Burot
 * @since 13.09.2014
 */
public class Mock {
    public static List<ReportMenuItem> getCityTree() {
        ArrayList<ReportMenuItem> items = new ArrayList<>();
        
        ReportMenuItem item1 = new ReportMenuItem(0, "Australia");
        ReportMenuItem item11 = new ReportMenuItem(1, "Adelaide");
        item1.addSubMenuItem(item11);
        ReportMenuItem item12 = new ReportMenuItem(2, "Brisbane");
        item1.addSubMenuItem(item12);
        ReportMenuItem item13 = new ReportMenuItem(3, "Sydney");
        item1.addSubMenuItem(item13);
        items.add(item1);
        
        ReportMenuItem item2 = new ReportMenuItem(0, "China");
        ReportMenuItem item21 = new ReportMenuItem(4, "Beijing");
        item2.addSubMenuItem(item21);
        ReportMenuItem item22 = new ReportMenuItem(5, "Chengdu");
        item2.addSubMenuItem(item22);
        items.add(item2);
        
        ReportMenuItem item3 = new ReportMenuItem(0, "Japan");
        ReportMenuItem item31 = new ReportMenuItem(6, "Kanazawa");
        item3.addSubMenuItem(item31);
        ReportMenuItem item32 = new ReportMenuItem(7, "Nagoya");
        item3.addSubMenuItem(item32);
        ReportMenuItem item33 = new ReportMenuItem(8, "Tokio");
        item3.addSubMenuItem(item33);
        ReportMenuItem item34 = new ReportMenuItem(9, "Toyohashi");
        item3.addSubMenuItem(item34);
        items.add(item3);
        
        ReportMenuItem item4 = new ReportMenuItem(0, "Singapore");
        ReportMenuItem item41 = new ReportMenuItem(10, "Singapore");
        item4.addSubMenuItem(item41);
        items.add(item4);
        
        ReportMenuItem item5 = new ReportMenuItem(0, "USA");
        ReportMenuItem item51 = new ReportMenuItem(11, "Los Angeles");
        item5.addSubMenuItem(item51);
        ReportMenuItem item52 = new ReportMenuItem(12, "New York");
        item5.addSubMenuItem(item52);
        ReportMenuItem item53 = new ReportMenuItem(13, "San Francisco");
        item5.addSubMenuItem(item53);
        items.add(item5);
        
        return items;
    }
    
    public static List<Country> getCountrys() {
        List<Country> countries = new ArrayList<>();
        
        countries.add(new Country(1, "Australia"));
        countries.add(new Country(2, "China"));
        countries.add(new Country(3, "Japan"));
        countries.add(new Country(4, "Singapore"));
        countries.add(new Country(5, "USA"));
        
        return countries;
    }
    
    public static List<City> getCitys(long idCountry) {
        List<City> citys = new ArrayList<>();
        
        if (idCountry == 1) {
            citys.add(new City(1, "Adelaide"));
            citys.add(new City(2, "Brisbane"));
            citys.add(new City(3, "Cairns"));
        } else if (idCountry == 2) {
            citys.add(new City(4, "Beijing"));
            citys.add(new City(5, "Chengdu"));
            citys.add(new City(6, "Guilin"));
            citys.add(new City(7, "Yangshuo"));
        }
        
        return citys;
    }
    
    public static List<TopMenuItem> getTopMenu() {
        ArrayList<TopMenuItem> items = new ArrayList<>();
        
        TopMenuItem item1 = new TopMenuItem("home", "Home");
        TopMenuItem item11 = new TopMenuItem("contact", "Contact");
        item1.addSubMenuItem(item11);
        items.add(item1);
        
        TopMenuItem item2 = new TopMenuItem("report", "Report");
        items.add(item2);
        
        TopMenuItem item3 = new TopMenuItem("impressum", "Impressum");
        items.add(item3);
        
        return items;
    }
    
    public static Report getReport(long id) {
        System.out.println("LALALA: id=" + id);
        if (id == 1) {
            Report r1 = new Report();
            r1.setId(1);
            r1.setAuthor(new Person(1, "Jean-Luc", "Burot"));
            r1.setTimeLog(new TimeLog(1,
                                      new Date(2014, 5, 21, 12, 42, 23),
                                      new Date(2014, 7, 23, 2, 54, 31),
                                      "Did something incredible amazing!"));
            r1.setReportCaption("Adelaide");
            r1.setReportContent("<p>Hier ist nun der <b>Bereich</b> der alles bezüglich der Stadt Adelaide in Australien anzeigt!</p>");
            return r1;
        } else if (id == 2) {
            Report r2 = new Report();
            r2.setId(2);
            r2.setAuthor(new Person(1, "Ben", "Kendik"));
            r2.setTimeLog(new TimeLog(1,
                                      new Date(2013, 2, 1, 15, 41, 15),
                                      new Date(),
                                      "Did something even more amazing!"));
            r2.setReportCaption("Brisbane");
            r2.setReportContent("<p>In diesem Fall werden die Inforationen bzgl. <b>Brisbane</b> aufgelistet!</p>");
            return r2;
        } else {
            /*
            Report rd = new Report();
            rd.setId(2);
            rd.setPerson(new Person(1, "Ben", "Kendik"));
            rd.setTimeLog(new TimeLog(1,
                                      new Date(),
                                      new Date(),
                                      "Did something even more amazing!"));
            rd.setReportContent("<p>Default Content!</p>");
            return rd;
                    */
            return null;
        }
    }
}
